﻿using System;

namespace DataCenter.Share
{
    [Serializable]
    public class TimePoint : ICloneable
    {
        public TimePoint() : this(1) { }
        public TimePoint(int fieldCount)
        {
            this.fieldCount = fieldCount;
            this.values = new float?[fieldCount];
        }
        
        private DateTime time;
        private int flag;
        private float?[] values;
        private int fieldCount;

        public DateTime Time
        {
            get { return time; }
            set { time = value; }
        }

        public int Flag
        {
            get { return flag; }
            set { flag = value; }
        }

        public float?[] Values
        {
            get { return values; }
            set { values = value; }
        }

        public float Value0
        {
            get { return values[0].Value; }
            set { values[0] = value; }
        }

        public int FieldCount
        {
            get { return fieldCount; }
        }

        public override string ToString()
        {
            return Value0.ToString();
        }

        #region ICloneable Members

        public object Clone()
        {
            return Utils.Clone(this);
        }

        #endregion
    }
}
